---
---

@import 'color';




// body
body {
    background-color: $gary-white;
}




/*---------------------------------------------------------------------------------- 页眉 */
// 布局
.gd-wrap-header {
    background-color: $primary;
}
.gd-header {
    display: flex;justify-content: space-between;align-items: center;
    padding: 20px;

    // 头像 & 个人信息
    &-col:nth-child(1) {
        display: flex;align-items: center;

        > :nth-child(n + 2) {
            margin: 0 0 0 4px;
        }

        a {
            display: none;
        }

        img {
            width: 40px;height: 40px;
            border-radius: 50%;
        }

        > div {
            display: flex;flex-direction: column;
            color: $gary-white;

            > :first-child {
                font-size: 14px;
            }

            > :last-child {
                margin: 4px 0 0;
                font-size: 12px;
            }
        }
    }

    // 搜索框
    &-col:nth-child(2) {
        display: flex;align-items: center;
        color: $gary-white;

        input {
            box-sizing: border-box;
            border: 2px solid $subordinate-light-regular;border-radius: 4px 0 0 4px;
            border-radius: 15px;
            padding: 0 40px 0 20px;
            width: 300px;height: 30px;
            line-height: 30px;color: $gary-white;
            background-color: transparent;
        }

        i {
            position: absolute;right: 30px;
            font-size: 20px;line-height: 20px;
        }
    }
}
@media screen and (max-width: 1080px) {
    .gd-header {
        padding: 10px 20px;
    
        // 头像 & 个人信息
        &-col:nth-child(1) {
            a {
                display: block;
                color: $gary-white;font-size: 30px;
            }

            img {
                display: none;
            }
        }
    
        // 搜索框
        &-col:nth-child(2) {
            display: flex;align-items: center;

            input {
                display: none;
            }

            i {
                position: static;right: 0;
            }
        }
    }
}

// 搜索弹层
.search-layer {
    display: none;
    position: fixed;top: 0;right: 0;bottom: 0;left: 0;z-index: 100;
    padding: 0 20px 0;
    background-color: rgb(255, 255, 255);

    &-content {
        display: flex;flex-direction: column;
        height: calc(100% - 200px);

        > :nth-child(n + 2) {
            margin: 40px 0 0;
            max-height: 50%;
        }
    }

    // 搜索框
    &-input-wrap {
        flex-shrink: 0;
        display: flex;justify-content: center;
    }

    &-input {
        position: relative;
        display: flex;align-items: center;
        height: 80px;
        font-size: 24px;
    
        input {
            width: 300px;height: 48px;
            padding: 0 40px;
            box-shadow: 0 0 0 2px $primary inset;border-radius: 24px;
        }
    
        i {
            position: absolute;right: 10px;
        }
    
        span {
            position: absolute;right: -58px;
            cursor: pointer;
        }
    }

    // 结果列表
    &-result {
        display: flex;flex-direction: column;
    
        &-label {
            height: 16px;
            font-size: 16px;color: $gary-light-primary;
        }

        &-list {
            padding: 0 20px;
            overflow: hidden;overflow-y: auto;
        }
    
        &-item {
            height: 20px;
            font-size: 20px;
            cursor: pointer;
    
            &.empty {
                color: $gary-light-primary;
                cursor: text;
            }
        }
    
        // 搜索结果
        &.current &-list {
            display: flex;flex-direction: column;
            margin: 20px 0 0;
    
            > :nth-child(n + 2) {
                margin: 20px 0 0;
            }
        }

        &.current &-item {
            display: flex;
        }

        &.current &-item i {
            color: $primary;font-style: normal;
        }
    
        // 搜索历史
        &.history &-list {
            display: flex;flex-wrap: wrap;
            margin: 10px 0 0;
            padding: 0 10px;
        }
    
        &.history &-item {
            margin: 10px 10px 0;
        }
    }
}
@media screen and (max-width: 1080px) {
    .search-layer {
        &-content {
            > :nth-child(n + 2) {
                margin: 20px 0 0;
            }
        }

        &-input {
            margin: 0 40px 0 0;
            height: 60px;
            font-size: 16px;
        
            input {
                width: 100%;height: 36px;
                padding: 0 20px;
            }

            span {
                right: -40px;
            }
        }
    
        // 结果列表
        &-result {
            &-label {
                height: 14px;
                font-size: 14px;
            }
        
            &-item {
                height: 16px;
                font-size: 16px;
            }
        }
    }
}




/*---------------------------------------------------------------------------------- 主体 */
.gd-wrap-body {
    background-color: $gary-white;
}
.gd-body {
    display: flex;
    margin: 0 auto;
    padding: 20px;

    > :nth-child(n + 2) {
        margin: 0 0 0 20px;
    }

    // 导航
    > :nth-child(1) {
        flex-shrink: 0;
        width: 160px;
    }

    // 博客详情
    > :nth-child(2) {
        flex-grow: 1;
        width: 960px;
    }

    // 边栏（tag & catgary）
    > :nth-child(3) {
        flex-shrink: 0;
        width: 200px;
    }

    &-col > :nth-child(n + 2) {
        margin: 20px 0 0;
    }
}
@media screen and (max-width: 1080px) {
    // 显隐
    .gd-body {
        > :nth-child(1) {
            display: none;
        }

        // 博客详情
        > :nth-child(2) {
            margin: 0;
            width: 100%;
        }

        > :nth-child(3) {
            display: none;
        }

        h1,
        h2,
        h3,
        h4,
        h5,
        h6 {
            padding-left: 10px;padding-right: 10px;
            margin-left: -20px !important;margin-right: -20px !important;
        }
    }
}


/*---------------------------------------------------------------------------------- 导航栏 */
.gd-navigation {
    display: flex;flex-direction: column;
    padding: 20px 0;
    background-color: $primary;

    a {
        position: relative;
        margin: 0 20px;
        line-height: 30px;font-size: 14px;color: $gary-white;
        background-color: $primary;

        &:before {
            content: '';
            position: absolute;left: 0;
            width: 4px;height: 100%;
            background-color: $primary;
        }

        i {
            padding: 0 10px 0 20px;
        }

        &.selected {
            background-color: $primary-dark-regular;

            &:before {
                background-color: $status-warn;
            }
        }
    }
}




/*---------------------------------------------------------------------------------- 博客列表 */
.gd-wrap-blogs {
    display: flex;flex-direction: column;

    > :nth-child(n + 1) {
        border-bottom: 1px solid gainsboro;
    }

    > :nth-child(n + 2) {
        margin: 20px 0 0;
    }
}
.gd-blogs {
    display: flex;flex-direction: column;
    cursor: pointer;

    &-row:nth-child(1) {
        display: flex;justify-content: space-between;

        i {
            margin: 0 20px 0 0;
            -webkit-line-clamp: 2;
            color: $gary-primary;font-size: 16px;font-style: normal;
        }

        span {
            flex-shrink: 0;
            text-align: right;color: $gary-light-primary;
        }
    }

    &-row:nth-child(2) {
        margin: 4px 0 4px;
        -webkit-line-clamp: 2;
        color: $gary-light-primary;font-size: 12px;
    }
}
.gd-wrap-paginator {
    display: flex;justify-content: center;
}
@media screen and (max-width: 1080px) {
    .gd-blogs {
       padding: 0 20px;
    }
}


/*---------------------------------------------------------------------------------- 详情页 - 上一篇 & 下一篇 */
.gd-nearbyBlog {
    display: flex;justify-content: space-between;

    &-col {
        position: relative;
        display: flex;flex-direction: column;justify-content: center;
        height: 40px;
    }

    &-col:nth-child(1) {
        padding: 0 0 0 40px;

        i {
            left: 0;
        }
    }

    &-col:nth-child(2) {
        padding: 0 40px 0 0;

        i {
            right: 0;
        }
    }

    i {
        position: absolute;
        font-size: 40px;color: $gary-light-primary;
    }

    b {
        font-weight: bold;font-size: 14px;color: $gary-light-primary;
    }

    a,
    span {
        margin: 4px 0 0;
        font-size: 14px;
    }

    span {
        color: $gary-light-regular;
    }
}



/*---------------------------------------------------------------------------------- 边栏 category & tag */
.gd-wrap-sidebar {
    display: flex;flex-direction: column;

    > :nth-child(n + 2) {
        margin: 20px 0 0;
    }
}
.gd-sidebar {
    display: flex;flex-direction: column;

    &-title {
        padding: 0 0 10px 0;
        border-bottom: 1px solid #c0c0c0;
        font-size: 16px;font-weight: bold;
    }

    &-content {
        display: flex;flex-wrap: wrap;
        padding: 0 0 10px;
    }

    &-item {
        padding: 10px 4px 0;
        cursor: pointer;
    }
}




/*---------------------------------------------------------------------------------- category.html & tag.html 分类 & 标签 */
.gd-wrap-category {
    display: flex;flex-direction: column;

    > :nth-child(n + 2) {
        margin: 10px 0 0;
    }
}
.gd-category {
    display: flex;flex-direction: column;

    &-title {
        font-size: 24px;font-weight: bold;
    }

    &-content {
        display: flex;flex-direction: column;
        padding: 10px 0 0;

        > :nth-child(n + 2) {
            margin: 10px 0 0;
        }

        a {
            font-size: 16px;
        }
    }
}


/*---------------------------------------------------------------------------------- 页脚 */
.gd-wrap-footer {
    padding: 10px 0;
    background-color: $gary-dark-primary;
}
.gd-footer {
    color: $gary-light-primary;text-align: center;font-size: 12px;
}




/*---------------------------------------------------------------------------------- 其它 */
#scroll-top {
    position: fixed;right: 20px;bottom: 40px;z-index: 90;
    border-radius: 50%;
    width: 2em;height: 2em;
    text-align: center;font-size: 20px;line-height: 2em;font-weight: bold;
    background-color: $gary-dark-primary;color: $gary-white;
    cursor: pointer;
}

.fixed {
    position: fixed;
}

#structure-fixed {
    position: fixed;bottom: 90px;right: 20px;z-index: 80;

    &.collapse {
        right: 0;
        transform: translateX(100%);
    }
    
    &-collapse {
        position: absolute;left: -24px;top: 50%;
        display: flex;flex-direction: column;align-items: center;
        border-radius: 8px 0 0 8px;
        width: 24px;
        padding: 10px 2px;
        color: #fff;
        transform: translateY(-50%);
        background-color: $primary;
        cursor: pointer;
    }

    > ul {
        max-width: 300px;max-height: 40vh;overflow: auto;
        border-radius: 5px;box-shadow: 0 0 3px 0 $gary-light-primary inset;
        padding: 10px;
        background-color: $gary-white;
    }

    .highlight {
        color: $subordinate-dark;font-weight: bold;
    }
}
@media screen and (max-width: 1080px) {
    #structure-fixed {
        bottom: 0;top: 0;right: 0;
        width: 80%;height: 100%;
        
        > ul {
            
            max-width: initial;max-height: initial;width: 100%;height: 100%;
        }
    }
}